import {request, METHOD} from '@/service/http.service'
export function getServiceList(params = {}) {
  return request({
    url: "/services",
    method: METHOD.GET,
    params
  }).then(({ data }) => data);
}


export function getServiceDetail(pk) {
  return request({
    url: `/services/${pk}`,
    method: METHOD.GET,
  }).then(({ data }) => data);
}


export function createService(serviceData) {
  return request({
    url: "/services/create",
    method: METHOD.POST, 
    data: serviceData,
  }).then(({ data }) => data);
}


export function updateService(pk, serviceData) {
  return request({
    url: `/services/${pk}/update`,
    method: METHOD.PUT, 
    data: serviceData,
  }).then(({ data }) => data);
}

export function deleteService(pk) {
  return request({
    url: `/services/${pk}/delete`,
    method: METHOD.DELETE,
  }).then(({ data }) => data);
}
